package cn.boy.service.impl;

import cn.boy.dao.DormitoryDao;
import cn.boy.dao.DormitoryDaoFactory;
import cn.boy.domain.Dormitory;
import cn.boy.service.DormitoryService;


public class DormitoryServiceImpl implements DormitoryService{

	private static DormitoryDaoFactory instance;
	private static DormitoryDao dao;
	static{
		instance = DormitoryDaoFactory.getInstance();
		dao= instance.getDormitoryDao();
	}

	public void addDormitory(Dormitory dormitory){
		dao.add(dormitory);
	}
	
	public void deleteDormitory(String no){
		dao.delete(no);
	}
	
	public void updateDormitory(Dormitory dormitory){
		dao.update(dormitory);
	}
	
	
	public String queryAllDormitory(){
		return dao.queryAll();
	}
	
	
	public String queryDormitory(String no){
		return dao.query(no);
	}
	
	public String queryDormitoryByPrex(String prex){
		return dao.queryByPrex(prex);
	}

	@Override
	public String rankDormitory(String prex, String date) {
		return dao.queryByPrexAndDate(prex, date);
	}

	@Override
	public String historyDormitory(String no) {
		return dao.query(no);
	}

	@Override
	public String latestMark(String no) {
		return dao.queryLatest(no);
	}


	
}
